import java.lang.annotation.Annotation;


public class Test04 {
    public static void main(String[] args) throws ClassNotFoundException {

        Class aClass = Class.forName("NewUser");
        Annotation declaredAnnotation = aClass.getDeclaredAnnotation(MyAnnotation.class);

        if(declaredAnnotation instanceof MyAnnotation){
            MyAnnotation myAnnotation =(MyAnnotation) declaredAnnotation;
            System.out.println(myAnnotation.name());
        }

        if(declaredAnnotation instanceof RestController){
            System.out.println("declaredAnnotation is a RestController annotation");
        }
        else{
            System.out.println("declaredAnnotation is not a RestController annotation");
        }
    }
}
